package com.zcl.Thread.t11;

/**
 * @Description:
 * @author: zcl
 * @date: 2022/3/9  13:45
 */
public class MyThread extends Thread{

    @Override
    public void run(){
        super.run();
        for (int i = 0; i < 500000; i++) {
            System.out.println("i = "+ (i+1));
        }
    }
}


class run {
    public static void main(String[] args) {

        try {
            MyThread myThread = new MyThread();
            myThread.start();
            Thread.sleep(2000);
            myThread.interrupt();
        } catch (InterruptedException e) {
            System.out.println("main catch!");
            e.printStackTrace();
        }
    }
}